package com.sky.mapper.admin;


import com.github.pagehelper.Page;
import com.sky.anno.AutoFill;
import com.sky.enumeration.OperationType;
import com.sky.pojo.Employee;
import org.apache.ibatis.annotations.*;



public interface EmployeeMapper {

    /**
     * 根据用户名查询员工
     * @param username
     * @return
     */
    @Select("select * from employee where username = #{username}")
    Employee getByUsername(String username);


    /**
     * 分页查询
     * @param name
     * @return
     */
    Page<Employee> pageQuery(String name);

    @AutoFill(OperationType.INSERT)
    void insert(Employee employee);

    @AutoFill(OperationType.UPDATE)
    void updateStatus(@Param("id") Long id,@Param("status") Integer status);

    Employee getById(Long id);

    @AutoFill(OperationType.UPDATE)
    void update(Employee employee);
}
